Repository navigation
feat(scanner): add a Kotlin scanner - #124
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The parser rejected a file starting with a UTF-8 byte order mark, which failed the whole scan. The mark is replaced by a space, as carriage returns already are, so offsets and lines still refer to the file on disk. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The outline kept the backticks of a quoted identifier while scan symbols and operations report the unquoted name, so a Code link written with the symbol name never marked its outline entry. The outline now reports the same name as scans. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… too deep A long generated chain overflowed the stack in the recursive call walk and the scan died with a raw JVM trace naming no file. The adapter now starts the worker with a 512 MB stack, and a file nested deeper than that fails the scan by name like any other unreadable file. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default exclusion build/ also dropped real source in a package directory named build, such as com.android.build. The defaults now restore a build folder under a source set's kotlin/ or java/ root, where it is a package and never Gradle output. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The default src/*Test/ missed src/testDebug/, src/androidTestDebug/ and src/testFixtures/, so their test code was scanned as product code although the documentation says test source sets are excluded. The defaults now also name a test source set followed by a capitalised variant. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One observation covers every selected file at about 115 bytes per source line, so a repository of roughly a million lines exceeded the 64 MB buffer and the scan was rejected. The adapter now reads the worker's output without a fixed limit. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A secondary constructor searched its whole declaration for calls while a function searched only its body, so a call in a parameter default was evidence for one and not the other. A function now searches its whole declaration too, because it runs its defaults. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A mutable var with a lambda initializer was reported as a function symbol and operation, which showed reassignable state as a fixed function. Only a val is a function value now. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The build shipped whatever Maven Central returned for the pinned versions, so a truncated or altered jar would still be published. Each artifact now carries the SHA-256 of the reviewed jar, matched against Maven Central's published SHA-1 for the same bytes, and a download that differs fails the build. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Kotlin adapter and build were near copies of the Scala scanner's, and the notices writer existed in three build scripts. plugins/scanners/jvm-worker.ts now owns running a worker on the bundled Java runtime and mapping its outline to Code entries for Kotlin and Scala. plugins/scanners/jvm-package.ts owns package assembly for both, and the notices writer and JDK tool lookup the Java build also uses. The shared runner has no fixed output limit, so the Scala adapter loses its 64 MB limit too. The worker module joins the Scala scanner component; the build helper is excluded from the architecture scan like the other build scripts. Refs: TASK-576 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f6a58dd to
d4d7faf
Compare
|
Hey @MrLesk @matteocodogno, sorry to post an unrelated question but it's the only way I found to contact you, I would love to raise an issue but I see it's turned off for this repo, is this intentional? the README showed links to the /issues page but when landing there I see "Issue creation is restricted in this repository" below the "Issues" button...
|
Sorry about that @evertdhont |
Record the maintainer review and local validation. Scanner source is unchanged; CI is running for 537e329 with the same source. [skip ci]


Adds the experimental Kotlin scanner so selected
.ktfiles can supply Groma's source inventory, top-level symbols, operations, unresolved calls and Code outlines. It parses source with Kotlin's bundled parser and Java runtime; scanning needs no installed Java/Kotlin, Gradle/Maven, project dependencies or project build.Backlog: TASK-578 — Add an experimental Kotlin scanner. The task filename and frontmatter use this unique ID. The branch includes current main.
The scanner follows the existing package, catalog and release flow. Kotlin rules stay in the worker; Groma core owns architecture boundaries. Kotlin packages and Gradle source sets do not create C4 containers. Architecture remains ordinary OKF Markdown with Code links.
Call evidence belongs to its actual operation. Nested functions, lambdas, local classes, object methods and property accessors do not donate deferred calls to the enclosing operation; immediate object initialization and parameter-default calls remain. Constructor visibility follows Kotlin's sealed/enum rules. Overrides inherit access from selected source context. If missing or ambiguous bases prevent proving access, only that member is omitted from the outline; scan evidence stays intact.
Limits: no semantic target resolution, build-module discovery,
.ktsscripts, HTTP facts or body fingerprints. Visibility lookup supports explicit imports (including aliases), qualified/same-package names and enclosing types; it does not resolve wildcard imports or type aliases. Same-name/arity overload candidates across the inheritance chain must agree on access. The package includes about 59 MB of compiler jars plus a Java runtime per supported host;java.desktopis required by the parser.Validation:
PATHand unchanged checkouts. Exact commits and qualification limits are in Kotlin validation.bun run checkpasses locally: Node 16/16; Bun 777 pass, 52 skipped, zero failures.CI for commit
6158f37dpasses on Windows, Linux and macOS, including repository checks, C# worker tests and standalone binary builds. The architecture workflow also passes. Publication is separate from this PR.